 <SCRIPT LANGUAGE="JavaScript">  
    function validation()
    {
        var temp="";
        var emailPattern = /^\w+@\w+(\.\w{2,3})+(\.\w{2,3})?$/;
        
        temp=document.getElementById('EmployerCompanyName');
        if( temp.value.length ==0 )
        {
            temp.focus();
            temp.style.backgroundColor='#FF9';
            alert('Please provide the name of the company');
            temp.style.backgroundColor='#FFF';
            return false;             
        }
    
        temp=document.getElementById('EmployerLocation');
        if( temp.value.length ==0 )
        {
            temp.focus();
            temp.style.backgroundColor='#FF9';
            alert('Please provide the location of the company');
            temp.style.backgroundColor='#FFF';
            return false;             
        }    
               
        temp=document.getElementById('EmployerEmail');
        if( !emailPattern.test(temp.value) )
        {
            temp.focus();
            temp.style.backgroundColor='#FF9';
            alert('Please enter the valid email for the company profile');
            temp.style.backgroundColor='#FFF';
            return false;             
        }  
    
    }        
    
    function test()
    {
        return confirm("Are you sure want to delete the photo ?");
    }
    
    function open_win(id)
    {
        window.open('view/'+id,"_blank","toolbar=no, location=yes, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=yes, top=100, left=100, width=930, height=600");
    }            
</SCRIPT>        
<?php
echo "<div class='form'>";
echo "<h2> Company Profile</h2>";
echo "<hr color='#2A7EF7'>";
    echo ":. See your company profile full page <a href='Javascript:open_win(".$this->data['Employer']['id'].")'>[ Here ]</a>";
    //echo "<br>:. See your company profile full page <a href='view/".$this->data['Employer']['id']."'>[ Here ]</a>";
    echo "<div class='kotak2'>";
    echo $form->create('Employer', array('action'=>'company_profile','type'=>'file','onsubmit'=>'return validation();'));
         echo "<div class='input'><label> &nbsp </label>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<span class='red'>*</span> <b>Required Field</b></div>";
        echo "<div class='input'>";
            echo "<label> Logo</label>";
            if($this->data['Employer']['logo']!='')
            {  
                echo $html->image('../'.$this->data['Employer']['logo'], array( 'class'=>'logo', 'alt' => 'Your Logo is Missing'));    
                echo "<br>";
                echo "<label> &nbsp </label>";
                echo $html->link('[ Edit Logo ]',array('controller'=>'employers','action'=>'logo'));
                echo "&nbsp&nbsp&nbsp&nbsp";
                echo $html->link('[ Delete Logo ]',array('controller'=>'resumes','action'=>'delete_photo'),array(),'Are you sure ?',false);

            }
            else
            {
                echo $html->link('[ Upload ]',array('controller'=>'employers','action'=>'logo'));
            }
        echo "</div>";
        
        echo $form->input('company_name', array ('maxLength'=>'40', 'size'=>'40','after'=>"<span class='red'><sup>*</sup></span>"));
        echo $form->input('industry', array ('label'=>'Type of Industry'));
        echo $form->input('location',array ('label'=>'Detail Location', 'size'=>'40','after'=>"<span class='red'><sup>*</sup></span>"));
        echo $form->input('city_id',array('after'=>"<span class='red'><sup>*</sup></span>"));
        echo $form->input('fax', array ('maxLength'=>'20'));
        echo $form->input('website', array ('maxLength'=>'40'));
        echo $form->input('email', array ('maxLength'=>'40','after'=>"<span class='red'><sup>*</sup></span>"));
		
		//echo $form->input('desc', array ('label'=>'Company Description', 'style'=>'height:220px;width:280px'));
        echo "<div class='input'>";
            echo "<label>Company Description</label>";
            echo "<textarea name='data[Employer][desc]' style='height:200px;width:280px'>".$this->data['Employer']['desc']."</textarea>";
        echo "</div>";
        
		//echo $form->input('other', array ('label'=>'Other Information', 'style'=>'height:220px;width:280px'));
        echo "<div class='input'>";
            echo "<label>Other Information</label>";
            echo "<textarea name='data[Employer][other]' style='height:200px;width:280px'>".$this->data['Employer']['other']."</textarea>";
        echo "</div>";
		
        echo "<div class='input'><label> &nbsp </label><input type='submit' value='Save'></div>";
    echo "</form>";
    echo "</div>";
        
echo "</div>";
?>

